package com.dhcc.bpm.modules.workflow.mapper;

import com.dhcc.bpm.modules.workflow.dto.TaskDto;
import com.dhcc.bpm.modules.workflow.entity.Approve;
import com.dhcc.bpm.modules.workflow.vo.ApproveVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ClassName ApproveMapper
 * @Description  工作流审批表 Mapper 接口
 * @Author YZC
 * @Date 2019/11/19 14:46
 * @Version V1.0
 * @Copyright: 2020 东华软件 . All rights reserved.
 */
public interface ApproveMapper extends BaseMapper<Approve> {

	/**
	 * @Description 自定义分页
	 * @Author daina
	 * @Date 13:27 2020/3/3
	 * @param page
	 * @param approve
	 * @return java.util.List<com.dhcc.bpm.modules.workflow.vo.ApproveVO>
	 **/
	List<ApproveVO> selectApprovePage(IPage page, ApproveVO approve);

	/**
	 * 删除脏数据实例
	 */
	int clearn(String processInstanceId);

	/**
	 * @Description 查询原数据
	 * @Author sjm
	 * @Date 20:46 2020/3/4 0004
	 * @param processId
	 * @return com.dhcc.bpm.modules.workflow.entity.Approve
	 **/
    Approve selectApprove(Long processId);

    /**
     * @Description 根据id查询
     * @Author sjm
     * @Date 18:40 2020/3/10 0010
     * @param busNo
     * @return com.dhcc.bpm.modules.workflow.vo.ApproveVO
     **/
	ApproveVO getApproById(Long busNo);

	/**
	 * @Description 根据业务编号和产品id查询集合
	 * @Author sjm
	 * @Date 16:18 2020/3/31 0031
	 * @param busNo
	 * @param productId
	 * @return com.dhcc.bpm.modules.workflow.entity.Approve
	 **/
    Approve getApproByProdAppId(Long busNo, Long productId);

    /**
     * @Description 根据id查询集合
     * @Author sjm
     * @Date 22:25 2020/4/3 0003
     * @param busNo
     * @return java.util.List<com.dhcc.bpm.modules.workflow.entity.Approve>
     **/
	List<Approve> selectApp(Long busNo);

	int deleteRelated( @Param("taskDto") TaskDto taskDto);

	TaskDto findBytask(TaskDto taskDto);
}
